﻿using CatUtils.Utils.Currency;
using CatUtils.Utils.Currency.IoUtils;

using CatUtils.Utils.SpecialUtils.View;
using CatUtilsDll.Utils.Currency.WebUtils;
using RabbitDownload.Helper.Currency;

using RabbitDownload.WebSite.Pixiv.Login;
using RabbitDownload.WebSite.Pixiv.PixivTag;
using System;
using System.Windows.Forms;

namespace RabbitDownload.WebSite.Pixiv.PixivTagMember
{
    public partial class PixivTagMemControl : UserControl
    {
        public PixivTagMemControl()
        {
            InitializeComponent();
            InitView();
        }

        private void InitView()
        {
            PixivStaticValue.BlockComic = checkBox1.Checked;
            PixivStaticValue.ExcludeOpenFlag = checkBox3.Checked;
            PixMemStaticvlaue.MemberFlag = checkBox4.Checked;
            PixMemStaticvlaue.BlockComicEnhance = false;//增强屏蔽
            Groupboxhelper.Replace(groupBox1, new Login.LoginControl());
        }

        private void button2_Click(object sender, EventArgs e)
        {
            CWebclient cWebclient = new LoginHelper().AutoLogin();
            if (cWebclient == null)
            {
                PrintLog.DNoWrite("登录失败");
                return;
            }
            new PTMStartScanner().InitStart(TagTBox.Text, StartPageTbox.Text, EndPageTBox.Text, ImgScoreTBox.Text, DownLoadCountTbox.Text, cWebclient);
        }

        private void checkBox3_CheckedChanged(object sender, EventArgs e)
        {
            PixivStaticValue.ExcludeOpenFlag = checkBox3.Checked;
        }

        private void checkBox1_CheckedChanged(object sender, EventArgs e)
        {
            PixivStaticValue.BlockComic = checkBox1.Checked;
            if (checkBox1.Checked)
                PixMemStaticvlaue.BlockComicEnhance = MessageHelper.DialogResultAlert("是否启用屏蔽增强模块(宽高辅助模式)？");
        }

        private void checkBox4_CheckedChanged(object sender, EventArgs e)
        {
            PixMemStaticvlaue.MemberFlag = checkBox4.Checked;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            PixivTagJsonNew.ListFileBatch(FileHelper.SelectFile());
            return;
            CWebclient cWebclient = new LoginHelper().AutoLogin();
            if (cWebclient == null)
                return;
            new PTMStartScanner().StartBatch(FileHelper.SelectFile(), StartPageTbox.Text, EndPageTBox.Text, ImgScoreTBox.Text, DownLoadCountTbox.Text, cWebclient);
        }
    }
}